package com.prd.controller;

import com.prd.model.EntGoal;
import com.prd.model.EntGoalCoach;
import com.prd.model.EntMeetSign;
import com.prd.service.EntGoalCoachService;
import com.prd.util.AjaxResult;
import com.prd.util.TableDataInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(tags = "目标辅导")
@RestController
@RequestMapping("/api/entGoalCoach")
public class EntGoalCoachController extends BaseController {

    @Autowired
    private EntGoalCoachService entGoalCoachService;

    @ApiOperation("查询列表")
    @GetMapping("list")
    public TableDataInfo list(EntGoalCoach entGoalCoach) {
        startPage();
        List<EntGoalCoach> list = entGoalCoachService.listInfo(entGoalCoach);
        return getDataPage(list);
    }

    @ApiOperation("添加信息")
    @PostMapping("add")
    public AjaxResult add(@RequestBody EntGoalCoach entGoalCoach) {
        return toAjax(entGoalCoachService.insertInfo(entGoalCoach));
    }

    @ApiOperation("修改信息")
    @PostMapping("update")
    public AjaxResult update(@RequestBody EntGoalCoach entGoalCoach) {
        return toAjax(entGoalCoachService.updateInfo(entGoalCoach));
    }

    @ApiOperation("查询详情")
    @GetMapping("details/{id}")
    public AjaxResult details(@PathVariable("id") Long id) {
        return AjaxResult.success(entGoalCoachService.details(id));
    }
}
